import java.io.BufferedReader;
import java.io.FileReader;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Scanner;

public class java03 {
    public static void main(String[] args) throws Exception{
        BufferedReader fis=new BufferedReader(new FileReader("user.txt"));
        HashMap<String,String> map=new HashMap<>();
        String line;
        while ((line= fis.readLine())!=null){
            map.put(line.split("=")[0],line.split("=")[1]);
        }
        System.out.println(map);
        Scanner sc=new Scanner(System.in);
        System.out.println("输入用户名");
        String user= sc.next();
        int i;
        for ( i = 1; i <=6 ; ){
        System.out.println("输入密码");
        String ss= sc.next();

            if (ss.equals(map.get(user))) {
                System.out.println("登陆成功");
                break;
            } else {
                System.out.println("密码错误");
                if (i == 3) {
                    try {
                        System.out.println("账户冻结十秒钟");
                        Thread.sleep(10000);  // 暂停 60 秒
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
                i++;
            }

        }
        while (i>6){
            System.out.println("账户已被冻结");
            break;
        }
    }
}
